import request from '@/utils/request'
import { getItem } from '@/utils/auth'

export function fetchParameterApplicationListByApplicationID(data) {
  return request({
    url: '/cloud-system/getParameterApplicationListByApplicationID',
    method: 'post',
    data
  })
}

export function fetchParameterApplicationList(data) {
  return request({
    url: '/cloud-system/getParameterApplicationList',
    method: 'post',
    data
  })
}

export function fetchParameterApplicationOne(data) {
  return request({
    url: '/cloud-system/getOneParameterApplicationDetail',
    method: 'post',
    data
  })
}

export function createParameterApplication(data) {
  return request({
    url: '/cloud-system/createOneParameterApplication',
    method: 'post',
    data
  })
}

export function updateParameterApplication(data) {
  return request({
    url: '/cloud-system/updateOneParameterApplication',
    method: 'post',
    data
  })
}

export function deleteParameterApplication(data) {
  return request({
    url: '/cloud-system/deleteOneParameterApplication',
    method: 'post',
    data
  })
}
export function batchDeleteParameterApplication(data) {
  return request({
    url: '/cloud-system/batchDeleteParameterApplication',
    method: 'post',
    data
  })
}

export function lockParameterApplication(data) {
  return request({
    url: '/cloud-system/lockOneParameterApplication',
    method: 'post',
    data
  })
}

export function unlockParameterApplication(data) {
  return request({
    url: '/cloud-system/unlockOneParameterApplication',
    method: 'post',
    data
  })
}

export function batchLockParameterApplication(data) {
  return request({
    url: '/cloud-system/batchLockParameterApplication',
    method: 'post',
    data
  })
}

export function batchUnLockParameterApplication(data) {
  return request({
    url: '/cloud-system/batchUnLockParameterApplication',
    method: 'post',
    data
  })
}

export function getParameterList(baseParam) {
  const data = Object.assign(JSON.parse(getItem('baseParam')), baseParam)
  return request({
    url: '/cloud-system/getParameterList',
    method: 'post',
    data: data
  })
}



